#!/usr/bin/env bash

echo "清理..."
mvn clean
echo "清理结束"
echo "重新构建..."
mvn package -Dmaven.test.skip=true
echo "重新构建结束"

echo "执行Dockerfile..."
docker build -t registry.cn-hangzhou.aliyuncs.com/sherry/mount-buzhou-service:202006.1 .
echo "执行Dockerfile结束"
docker login --username=545393870@qq.com registry.cn-hangzhou.aliyuncs.com
echo "推送远端..."
docker push registry.cn-hangzhou.aliyuncs.com/sherry/mount-buzhou-service:202006.1
echo "推送远端结束"

docker rmi $(docker images | grep "mount-buzhou-service" | awk '{print $3}')
git add -A
git commit -m "更新"
git push